<?php
	$guestbook = $dataObj->GetInformation();
	
	if(isset($guestbook) && $guestbook != null)
	{
		foreach($guestbook as $msg)
		{
			echo 
			"<div class='guestbookEntry'>
				<p>"
					. $msg['name'] .
				"</p>
				<p class='guestbookMessage'>"
				. nl2br($msg['message']) .	
				"</p>
			 </div>";
		}
	}
	
	// Configuration
	$data = array(
	    "id"	=> "newGuestbookEntryButton",
	    "name"	=> "newGuestbookEntryButton",
	    "type"	=> "submit",
	    "value"	=> "Leave a message");
		
	$authorConf = array(
		"id"	=> "guestbookInputAuthor",
		"name"	=> "name",
		"value" => set_value("name"));
	
	$textConf = array(
		"id"	=> "message",
		"name"	=> "message",
		"value" => set_value("message"));
		
	$attributes = array(
	    "name"	=> "newGuestbookEntryForm",
	    "id"	=> "newGuestbookEntryForm");
    
    // Printing
	echo	
	"<div class='validation'>" .
		validation_errors() . 
	"</div>" .	
	"<div id='newGuestbookEntry'>".
		form_open(current_url(), $attributes)
		
			."<p>Name:</p>"
			."<p>". form_input($authorConf) . "</p>"
			
			."<p>Guestbook entry:" . "</p>"
			."<p>". form_textarea($textConf) . "</p>"
			
			."<p>". form_submit($data) . "</p>" .
		form_close() . "
	</div>";
